<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
 <head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta http-equiv="Pragma" content="no-cache">
  
  <script src="intelxdk.js"></script>
  <script src="cordova.js"></script>
  <script src="xhr.js"></script>
  <!--
      Include xhr.js in your index.html when using web services that make cross origin requests
      This file makes those requests successfully when testing your apps under the "EMULATE", "BUILD" & "TEST" tab with the 
      Intel(R) App Preview mobile app.
      DISCLAIMER: If you don't need to perform these requests, remove the following script (xhr.js)
  -->
  <script type="text/javascript">
   /* This code is used to run as soon as Intel activates */
   		var onDeviceReady=function(){
   		//hide splash screen
   		intel.xdk.device.hideSplashScreen();
   		};
   		document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);
  </script>
  <script type="application/javascript" src="js/jquery.min.js"></script>
  <script type="application/javascript" src="app_framework/appframework.ui.min.js"></script>
  <script type="application/javascript" src="js/index_user_scripts.js"></script>
  <script type="application/javascript" src="js/af_subpage.js"></script>
  <!--   
   You may substitute jQuery for the App Framework selector library.
   See http://app-framework-software.intel.com/documentation.php#afui/afui_jquery
  -->
  <script type="application/javascript" src="app_framework/appframework.js"></script>
  <link rel="stylesheet" type="text/css" href="app_framework/css/af.ui.min.css">
  <link rel="stylesheet" type="text/css" href="app_framework/css/icons.min.css">
  <link rel="stylesheet" type="text/css" href="css/index_main.less.css" class="main-less">
  <link rel="stylesheet" type="text/css" href="media_button_bar/css/media_button_bar.css">
  <style type="text/css">
   /* Prevent copy paste for all elements except text fields */
      *  { -webkit-user-select:none; -webkit-tap-highlight-color:rgba(255, 255, 255, 0); }
      input, textarea  { -webkit-user-select:text; }
  </style>
 </head>

 <body id="afui" class="">

  <!-- content goes here-->
  <div class="uwrap" id="content">
   <div class="upage panel" id="mainpage" data-header="af-header-0" data-footer="af-footer-0">
    <div class="upage-outer">
     <header class="container-group inner-element uib_w_1" data-uib="app_framework/header" data-ver="0" id="af-header-0">
      <h1>Newsletter</h1>
      <div class="widget-container wrapping-col single-centered"></div>
      <div class="widget-container content-area horiz-area wrapping-col left"></div>
      <div class="widget-container content-area horiz-area wrapping-col right"></div>
     </header>
     <div class="upage-content" id="mainsub">

      <div class="grid grid-pad urow uib_row_1 row-height-1" data-uib="layout/row" data-ver="0">
       <div class="col uib_col_1 col-0_12-12" data-uib="layout/col" data-ver="0">
        <div class="widget-container content-area vertical-col">

         <div class="widget uib_w_2 d-margins" data-uib="media/text" data-ver="0">
          <div class="widget-container left-receptacle"></div>
          <div class="widget-container right-receptacle"></div>
          <div>
           <blockquote>
            <p>WINS Global has a FREE interesting monthly publication.</p>
           </blockquote>
           <ul>
            <li>Find the latest products in our online MARKETPLACE</li>
            <li>Special offerings for members: TRAVEL, hotels, car rentals, airlines etc</li>
            <li>Helpful info and tips</li>
            <li>EVENTS-coming-up: purchasing your ticket online with discounted prices</li>
            <li>MY GARAGE SALE updates: upload your item images that you plan to sale in our My Garage Sale</li>
           </ul>
          </div>
         </div>
         <span class="uib_shim"></span>
        </div>
       </div>
       <span class="uib_shim"></span>
      </div>
     </div>
     <div id="failed_join" class="upage-content hidden">

      <div class="grid grid-pad urow uib_row_9 row-height-9" data-uib="layout/row" data-ver="0">
       <div class="col uib_col_6 col-0_12-12" data-uib="layout/col" data-ver="0">
        <div class="widget-container content-area vertical-col">

         <div class="widget uib_w_17 d-margins" data-uib="media/text" data-ver="0">
          <div class="widget-container left-receptacle"></div>
          <div class="widget-container right-receptacle"></div>
          <div>
           <p>Your email already listed</p>
          </div>
         </div><span class="uib_shim"></span>
        </div>
       </div>
       <span class="uib_shim"></span>
      </div>
     </div>
     <div id="uib_page_1" class="upage-content hidden">
     </div>
     <div id="success_join" class="upage-content hidden">

      <div class="grid grid-pad urow uib_row_8 row-height-8" data-uib="layout/row" data-ver="0">
       <div class="col uib_col_5 col-0_12-12" data-uib="layout/col" data-ver="0">
        <div class="widget-container content-area vertical-col">

         <div class="widget uib_w_15 d-margins" data-uib="media/text" data-ver="0">
          <div class="widget-container left-receptacle"></div>
          <div class="widget-container right-receptacle"></div>
          <div>
           <p>Thanks for joining</p>
          </div>
         </div><span class="uib_shim"></span>
        </div>
       </div>
       <span class="uib_shim"></span>
      </div>
     </div>

     <div id="profile_page" class="upage-content hidden">

      <div class="grid grid-pad urow uib_row_7 row-height-7" data-uib="layout/row" data-ver="0">
       <div class="col uib_col_4 col-0_12-12" data-uib="layout/col" data-ver="0">
        <div class="widget-container content-area vertical-col">

         <ul class="list widget uib_w_16 d-margins" data-uib="app_framework/listview" data-ver="0" > 

         </ul><span class="uib_shim"></span>
        </div>
       </div>
       <span class="uib_shim"></span>
      </div>
     </div>

     <div id="messages_page" class="upage-content hidden">

      <div class="grid grid-pad urow uib_row_3 row-height-3" data-uib="layout/row" data-ver="0">
       <div class="col uib_col_3 col-0_12-12" data-uib="layout/col" data-ver="0">
        <div class="widget-container content-area vertical-col">

         <div class="table-thing with-label widget uib_w_9 d-margins" data-uib="app_framework/input" data-ver="0">
          <form method="post" id="form_join">
           <label class="narrow-control label-inline">Email</label>
           <input class="wide-control" placeholder="your_email@domain.com" type="text" name="email" id = "email"> 
           <input type="submit" class="button widget uib_w_10 d-margins" data-uib="app_framework/button" data-ver="0" id="joining" value="Join"><span class="uib_shim"></span>
          </form>
         </div> 

        </div>
       </div>
       <span class="uib_shim"></span>
      </div>
     </div>

     <!-- /upage-content -->

     <footer class="inner-element uib_w_3" data-uib="app_framework/footer" data-ver="0" id="af-footer-0"><a class="widget uib_w_5 d-margins icon home" data-uib="app_framework/button" data-ver="0" id="homebtn">Home</a><a class="widget uib_w_6 d-margins icon mail" data-uib="app_framework/button" data-ver="0" id="favbtn">Newsletter</a><a class="widget uib_w_4 d-margins icon chat"
      data-uib="app_framework/button" data-ver="0" id="messagebtn">Join</a>
     </footer>
    </div>
    <!-- /upage-outer -->

   </div>

   <!-- /upage -->

  </div>
  <script type="application/javascript">
    $( document ).on( "tap", ".link", function() {
        url = $(this).attr("rel");   
        loadURL(url);
    });
    
    function loadURL(url){
        navigator.app.loadUrl(url, { openExternal:true });
        return false;
    }
   $.ajax({ 
				
				url: "https:/www.winsglobal.com/newsletter/get_newsletter_all" ,
				 
				success: function (data) {     
                var jsonData = JSON.parse(data);  
                    optmin = "";
                     
                    $.each(jsonData.newsletternya, function(i, v) { 
                        var datanya = jsonData.newsletternya[i];
                        
optmin += '<li class="widget uib_w_13" data-uib="app_framework/listitem" data-ver="0"><a href ="#" rel="https://winsglobal.s3.amazonaws.com/uploads/'+datanya.newsletter_url+ '" class="link" >'+datanya.newsletter_title+'</a></li>';
                        
//                        optmin += '<li class="widget uib_w_13" data-uib="app_framework/listitem" data-ver="0"><a href ="https://winsglobal.s3.amazonaws.com/uploads/'+datanya.newsletter_url+ '" >'+datanya.newsletter_title+'</a></li>';
                        
//var urlnya = 'https://winsglobal.s3.amazonaws.com/uploads/'+datanya.newsletter_url;
                        
//optmin += '<li class="widget uib_w_13" data-uib="app_framework/listitem" data-ver="0"><a href ="#" onclick="javascript:window.openPDF('+urlnya+')" class="link" >'+datanya.newsletter_title+'</a></li>';
											 
						$( ".uib_w_16" ).html(optmin);  
                        
                    });    
                     
                } 
            });
  </script>
  <!-- /uwrap -->
 </body>

</html>